{layout name="layout" /}
<div class="layui-col-md10" style="margin-top: 20px">
    <form class="layui-form" action="{:url('index/articleAdd')}" enctype="multipart/form-data"  method="post">
        <div class="layui-form-item">
            <label class="layui-form-label">选择框</label>
            <div class="layui-input-block">
                <select name="class_id" lay-verify="required">
                    <option value=""></option>
                    {volist name='data' id='val'}
                        <option value="{$val['id']}">{$val['name']}</option>
                    {/volist}
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">文章标题</label>
            <div class="layui-input-block">
                <input type="text" name="title" required  lay-verify="required" placeholder="请输入新的分类名称" autocomplete="off" class="layui-input">
            </div>
        <div class="layui-form-item">
            <label class="layui-form-label">文本框</label>
            <div class="layui-input-block">
                <textarea id="demo" name="content" style="display: none;"></textarea>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
            </div>
        </div>

    </form>
</div>
<script>
    //富文本编辑器
    layui.use('layedit', function(){
        var layedit = layui.layedit;
        layedit.set({
            uploadImage: {
                url: '{:url("index/upload")}', //接口url
                type: 'post' //默认post
            }
        });
        layedit.build('demo'); //建立编辑器
    });
    //Demo
    layui.use('form', function(){
        var form = layui.form;
    });
</script>